<?php
namespace backend\models\article;

use yii\db\ActiveRecord;

class Artlable extends ActiveRecord
{
    /**
     * @return string 返回该AR类关联的数据表名
     */
    public static function tableName()
    {
        return 'edu_artlable';
    }
   
    
    /** 
     * @inheritdoc 
     */  
    public function rules()  
    {  
        return [  
            [['artlable_name','artlable_sort'], 'required'],    
            [['artlable_name'],'string', 'max' => 15],
            [['artlable_name'], 'unique','message'=>'{attribute}已经被占用了'],
        ];  
    }


    /** 
     * @inheritdoc  查询标签
     */  
    public function getLable($pages)  
    {  
        return $this->find($pages)
                ->orderby('artlable_sort desc')
                ->offset($pages->offset)
                ->limit($pages->limit)
                ->asArray()
                ->all();
    }	
}
?>